public class Hall {
    private String name;
    private int rows;
    private int cols;
    private boolean[][] seats;   // true = 已售出，false = 空闲

    public Hall(String name, int rows, int cols) {
        this.name = name;
        this.rows = rows;
        this.cols = cols;
        seats = new boolean[rows][cols];
    }

    public String getName() { return name; }

    public int getRows() { return rows; }

    public int getCols() { return cols; }

    public boolean isSeatAvailable(int r, int c) {
        if (r < 1 || r > rows || c < 1 || c > cols) {
            return false;
        }
        return !seats[r - 1][c - 1];
    }

    public void occupySeat(int r, int c) {
        seats[r - 1][c - 1] = true;
    }

    public void releaseSeat(int r, int c) {
        seats[r - 1][c - 1] = false;
    }

    public void showSeats() {
        System.out.println("放映厅：" + name);
        for (int r = 0; r < rows; r++) {
            for (int c = 0; c < cols; c++) {
                System.out.print(seats[r][c] ? "X " : "O ");
            }
            System.out.println();
        }
    }
}